package com.zjj.userservice.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zjj.userservice.dao.UserMapper;
import com.zjj.userservice.model.User;
import com.zjj.userservice.service.IUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: zhaojj
 * @create: 2019-07-15 15:06
 **/
@Service
public class UserService implements IUserService {
    @Resource
    UserMapper userMapper;

    @Override
    public PageInfo<User> getUserList(User user, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<User> list =userMapper.selectList(user);
        PageInfo<User> pageInfo = new PageInfo<>(list);
        return pageInfo;
    }
}
